package com.netty.rpc;

import com.netty.rpc.api.ComputeApi;
import com.netty.rpc.api.SayHelloApi;
import com.netty.rpc.proxy.ProxyClass;

/**
 * Hello world!
 *
 */
public class TestConsumer {

    public static void main( String[] args ) {
        //创建一个对象代理你的请求
        ComputeApi api = ProxyClass.create(ComputeApi.class);

        System.out.println("1+1="+api.add(1,1));
        System.out.println("5-1="+api.sub(5,1));

        //创建一个SayHello远程代理对象
        SayHelloApi sayHelloApi = ProxyClass.create(SayHelloApi.class);

        System.out.println(sayHelloApi.sayHello("上帝a"));
    }
}
